<?php
/**
 * Created by PhpStorm.
 * User: woody
 * Date: 17-2-16
 * Time: 下午10:46
 */

namespace App\Http\Controllers\Admin;
use App\Models\Banner;
use Illuminate\Http\Request;
use Session;



class TestController extends AdminController {

    public function getbaseinfo(){

        $appid="wxbb745d806aa9cdcb";
        $redirect_uri=urlencode("http://lhlalicy.top/");
        $url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".$appid."&redirect_uri=".$redirect_uri."&response_type=code&scope=snsapi_base&state=123#wechat_redirect";
        header('location:'.$url);

    }

    public function  getopenid(){
        $appid="wxbb745d806aa9cdcb";
        $appsecret="af66340dc225f289a510b92db48c06b3";
        $code=$_GET['code'];
        $url="https://api.weixin.qq.com/sns/oauth2/access_token?appid=".$appid."&secret=".$appsecret."&code=".$code."&grant_type=authorization_code";

    }

    public function test(){

////    echo  Config('app.set.url');
//        $inviterInfo = \DB::table('users')
//            ->select('invitecount')
//            ->where('id', 4)
//            ->first();
//
//        $setdata=[
//            'invitercount'=>$inviterInfo->invitecount+1,
//        ];
//        print_r($setdata);
//      //  var_dump($inviterInfo->invitecount);
//        $userData = [
//            'user_id' => 1,
//
//
//        ];
//        $user=\DB::table('vipuser')->insert($userData);
//        return $user;
    }


}
